Optimal. Leaf size=156 \[ -\frac{a^4 (7 A-4 i B) \log (\sin (c+d x))}{d}-\frac{a^4 (A-4 i B) \log (\cos (c+d x))}{d}-\frac{(2 B+5 i A) \cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{2 d}-8 a^4 x (B+i A)-\frac{3 A \left (a^4+i a^4 \tan (c+d x)\right )}{d}-\frac{a A \cot ^2(c+d x) (a+i a \tan (c+d x))^3}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.442379, antiderivative size = 156, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 34, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.147, Rules used = {3593, 3594, 3589, 3475, 3531} \[ -\frac{a^4 (7 A-4 i B) \log (\sin (c+d x))}{d}-\frac{a^4 (A-4 i B) \log (\cos (c+d x))}{d}-\frac{(2 B+5 i A) \cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{2 d}-8 a^4 x (B+i A)-\frac{3 A \left (a^4+i a^4 \tan (c+d x)\right )}{d}-\frac{a A \cot ^2(c+d x) (a+i a \tan (c+d x))^3}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3593
Rule 3594
Rule 3589
Rule 3475
Rule 3531
Rubi steps
\begin{align*} \int \cot ^3(c+d x) (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx &=-\frac{a A \cot ^2(c+d x) (a+i a \tan (c+d x))^3}{2 d}+\frac{1}{2} \int \cot ^2(c+d x) (a+i a \tan (c+d x))^3 (a (5 i A+2 B)+a (A+2 i B) \tan (c+d x)) \, dx\\ &=-\frac{a A \cot ^2(c+d x) (a+i a \tan (c+d x))^3}{2 d}-\frac{(5 i A+2 B) \cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{2 d}+\frac{1}{2} \int \cot (c+d x) (a+i a \tan (c+d x))^2 \left (-2 a^2 (7 A-4 i B)+6 i a^2 A \tan (c+d x)\right ) \, dx\\ &=-\frac{a A \cot ^2(c+d x) (a+i a \tan (c+d x))^3}{2 d}-\frac{(5 i A+2 B) \cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{2 d}-\frac{3 A \left (a^4+i a^4 \tan (c+d x)\right )}{d}+\frac{1}{2} \int \cot (c+d x) (a+i a \tan (c+d x)) \left (-2 a^3 (7 A-4 i B)-2 a^3 (i A+4 B) \tan (c+d x)\right ) \, dx\\ &=-\frac{a A \cot ^2(c+d x) (a+i a \tan (c+d x))^3}{2 d}-\frac{(5 i A+2 B) \cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{2 d}-\frac{3 A \left (a^4+i a^4 \tan (c+d x)\right )}{d}+\frac{1}{2} \int \cot (c+d x) \left (-2 a^4 (7 A-4 i B)-16 a^4 (i A+B) \tan (c+d x)\right ) \, dx+\left (a^4 (A-4 i B)\right ) \int \tan (c+d x) \, dx\\ &=-8 a^4 (i A+B) x-\frac{a^4 (A-4 i B) \log (\cos (c+d x))}{d}-\frac{a A \cot ^2(c+d x) (a+i a \tan (c+d x))^3}{2 d}-\frac{(5 i A+2 B) \cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{2 d}-\frac{3 A \left (a^4+i a^4 \tan (c+d x)\right )}{d}-\left (a^4 (7 A-4 i B)\right ) \int \cot (c+d x) \, dx\\ &=-8 a^4 (i A+B) x-\frac{a^4 (A-4 i B) \log (\cos (c+d x))}{d}-\frac{a^4 (7 A-4 i B) \log (\sin (c+d x))}{d}-\frac{a A \cot ^2(c+d x) (a+i a \tan (c+d x))^3}{2 d}-\frac{(5 i A+2 B) \cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{2 d}-\frac{3 A \left (a^4+i a^4 \tan (c+d x)\right )}{d}\\ \end{align*}
Mathematica [B] time = 10.3433, size = 1116, normalized size = 7.15 \[ a^4 \left (\frac{x (\cot (c+d x)+i)^4 (B+A \cot (c+d x)) \left (-\frac{71}{2} i A \cos ^4(c)-22 B \cos ^4(c)+7 A \cot (c) \cos ^4(c)-4 i B \cot (c) \cos ^4(c)-\frac{145}{2} A \sin (c) \cos ^3(c)+50 i B \sin (c) \cos ^3(c)+75 i A \sin ^2(c) \cos ^2(c)+60 B \sin ^2(c) \cos ^2(c)+\frac{1}{2} i A \cos ^2(c)+2 B \cos ^2(c)+40 A \sin ^3(c) \cos (c)-40 i B \sin ^3(c) \cos (c)+\frac{3}{2} A \sin (c) \cos (c)-6 i B \sin (c) \cos (c)-\frac{19}{2} i A \sin ^4(c)-14 B \sin ^4(c)-\frac{3}{2} i A \sin ^2(c)-6 B \sin ^2(c)+(4 \cos (2 c) A+3 A-4 i B \cos (2 c)) \csc (c) \sec (c) (i \sin (4 c)-\cos (4 c))-\frac{1}{2} A \sin ^4(c) \tan (c)+2 i B \sin ^4(c) \tan (c)-\frac{1}{2} A \sin ^2(c) \tan (c)+2 i B \sin ^2(c) \tan (c)\right ) \sin ^5(c+d x)}{(\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}+\frac{(\cot (c+d x)+i)^4 (B+A \cot (c+d x)) (7 A \cos (2 c)-4 i B \cos (2 c)-7 i A \sin (2 c)-4 B \sin (2 c)) \left (i \tan ^{-1}(\tan (5 c+d x)) \cos (2 c)+\tan ^{-1}(\tan (5 c+d x)) \sin (2 c)\right ) \sin ^5(c+d x)}{d (\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}+\frac{(\cot (c+d x)+i)^4 (B+A \cot (c+d x)) (A \cos (2 c)-4 i B \cos (2 c)-i A \sin (2 c)-4 B \sin (2 c)) \left (\frac{1}{2} i \log \left (\cos ^2(c+d x)\right ) \sin (2 c)-\frac{1}{2} \cos (2 c) \log \left (\cos ^2(c+d x)\right )\right ) \sin ^5(c+d x)}{d (\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}+\frac{(\cot (c+d x)+i)^4 (B+A \cot (c+d x)) (7 A \cos (2 c)-4 i B \cos (2 c)-7 i A \sin (2 c)-4 B \sin (2 c)) \left (\frac{1}{2} i \log \left (\sin ^2(c+d x)\right ) \sin (2 c)-\frac{1}{2} \cos (2 c) \log \left (\sin ^2(c+d x)\right )\right ) \sin ^5(c+d x)}{d (\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}+\frac{(A-i B) (\cot (c+d x)+i)^4 (B+A \cot (c+d x)) (-8 i d x \cos (4 c)-8 d x \sin (4 c)) \sin ^5(c+d x)}{d (\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}+\frac{B (\cot (c+d x)+i)^4 (B+A \cot (c+d x)) \sec (c) (\cos (4 c)-i \sin (4 c)) \sin (d x) \tan (c+d x) \sin ^4(c+d x)}{d (\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}+\frac{(\cot (c+d x)+i)^4 (B+A \cot (c+d x)) \csc (c) (\cos (4 c)-i \sin (4 c)) (4 i A \sin (d x)+B \sin (d x)) \sin ^4(c+d x)}{d (\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}+\frac{(\cot (c+d x)+i)^4 (B+A \cot (c+d x)) \left (\frac{1}{2} i A \sin (4 c)-\frac{1}{2} A \cos (4 c)\right ) \sin ^3(c+d x)}{d (\cos (d x)+i \sin (d x))^4 (A \cos (c+d x)+B \sin (c+d x))}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.074, size = 166, normalized size = 1.1 \begin{align*} -{\frac{A{a}^{4}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}-8\,B{a}^{4}x+{\frac{B{a}^{4}\tan \left ( dx+c \right ) }{d}}-8\,{\frac{B{a}^{4}c}{d}}+{\frac{4\,iB{a}^{4}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}-{\frac{4\,iA\cot \left ( dx+c \right ){a}^{4}}{d}}+{\frac{4\,iB{a}^{4}\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}-7\,{\frac{A{a}^{4}\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}-8\,iAx{a}^{4}-{\frac{8\,iA{a}^{4}c}{d}}-{\frac{A{a}^{4} \left ( \cot \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-{\frac{\cot \left ( dx+c \right ) B{a}^{4}}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 2.10328, size = 149, normalized size = 0.96 \begin{align*} -\frac{16 \,{\left (d x + c\right )}{\left (i \, A + B\right )} a^{4} - 2 \,{\left (4 \, A - 4 i \, B\right )} a^{4} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 2 \,{\left (7 \, A - 4 i \, B\right )} a^{4} \log \left (\tan \left (d x + c\right )\right ) - 2 \, B a^{4} \tan \left (d x + c\right ) - \frac{2 \,{\left (-4 i \, A - B\right )} a^{4} \tan \left (d x + c\right ) - A a^{4}}{\tan \left (d x + c\right )^{2}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.54735, size = 678, normalized size = 4.35 \begin{align*} \frac{10 \, A a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \,{\left (A - 2 i \, B\right )} a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} - 4 \,{\left (2 \, A - i \, B\right )} a^{4} -{\left ({\left (A - 4 i \, B\right )} a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} -{\left (A - 4 i \, B\right )} a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} -{\left (A - 4 i \, B\right )} a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} +{\left (A - 4 i \, B\right )} a^{4}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) -{\left ({\left (7 \, A - 4 i \, B\right )} a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} -{\left (7 \, A - 4 i \, B\right )} a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} -{\left (7 \, A - 4 i \, B\right )} a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} +{\left (7 \, A - 4 i \, B\right )} a^{4}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )}{d e^{\left (6 i \, d x + 6 i \, c\right )} - d e^{\left (4 i \, d x + 4 i \, c\right )} - d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 16.9671, size = 228, normalized size = 1.46 \begin{align*} \frac{\frac{10 A a^{4} e^{- 2 i c} e^{4 i d x}}{d} + \frac{\left (2 A a^{4} - 4 i B a^{4}\right ) e^{- 4 i c} e^{2 i d x}}{d} - \frac{\left (8 A a^{4} - 4 i B a^{4}\right ) e^{- 6 i c}}{d}}{e^{6 i d x} - e^{- 2 i c} e^{4 i d x} - e^{- 4 i c} e^{2 i d x} + e^{- 6 i c}} + \operatorname{RootSum}{\left (z^{2} d^{2} + z \left (8 A a^{4} d - 8 i B a^{4} d\right ) + 7 A^{2} a^{8} - 32 i A B a^{8} - 16 B^{2} a^{8}, \left ( i \mapsto i \log{\left (\frac{i d e^{- 2 i c}}{3 A a^{4}} + e^{2 i d x} + \frac{\left (4 A - 4 i B\right ) e^{- 2 i c}}{3 A} \right )} \right )\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.73924, size = 433, normalized size = 2.78 \begin{align*} -\frac{A a^{4} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 16 i \, A a^{4} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 4 \, B a^{4} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 16 \,{\left (8 \, A a^{4} - 8 i \, B a^{4}\right )} \log \left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + i\right ) + 8 \,{\left (A a^{4} - 4 i \, B a^{4}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) + 8 \,{\left (A a^{4} - 4 i \, B a^{4}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) + 8 \,{\left (7 \, A a^{4} - 4 i \, B a^{4}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) - \frac{8 \,{\left (A a^{4} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 4 i \, B a^{4} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 2 \, B a^{4} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - A a^{4} + 4 i \, B a^{4}\right )}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1} - \frac{84 \, A a^{4} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 48 i \, B a^{4} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 16 i \, A a^{4} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 4 \, B a^{4} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - A a^{4}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2}}}{8 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]